package cc.lj.internal.merchant.interfaces.facade;

import cc.lj.internal.core.exception.SysExceptionEnum;
import cc.lj.internal.core.http.HttpResult;
import cc.lj.internal.merchant.application.service.MerchantContractSignedAppService;
import cc.lj.internal.merchant.interfaces.dto.MerchantContractSignedDTO;
import cc.lj.internal.merchant.interfaces.dto.query.MerchantContractSignedQuery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 商户合同签订接口信息
 * @author liangxifeng
 * @date 2022-07-07
 */

@RestController
@RequestMapping("/merchantContractSigned")
@Slf4j
public class MerchantContractSignedController {

    @Resource(name = "merchantContractSignedAppService")
    private MerchantContractSignedAppService appService;

    /**
     * 通过字段等值查询 无分页
     * @param signedQuery
     * @return
     */
    @PostMapping("/getList")
    public HttpResult<List<MerchantContractSignedDTO>> getList(@Valid @RequestBody MerchantContractSignedQuery signedQuery)
    {
        List<MerchantContractSignedDTO> signedDTOS = appService.getList(signedQuery);
        return HttpResult.success(SysExceptionEnum.SUCCESS.getCode(),SysExceptionEnum.SUCCESS.getMessage(),signedDTOS);
    }
}
